﻿@model DogsClub.WebUI.Models.ExpositionWinner

@{
    Layout = "~\\Views\\Shared\\_Layout4.cshtml";


    List<SelectListItem> allMember = new List<SelectListItem>();
    if (ViewData["AllMember"] != null) 
    {
        var res = ViewData["allMember"] as  IEnumerable <DogsClub.WebUI.Models.Dog>;
        allMember.AddRange(res.Select(item => new SelectListItem() { Text = item.Name, Value = item.Id.ToString()}));
    }

    List<SelectListItem> allAvard = new List<SelectListItem>();
    if (ViewData["allAvard"] != null) 
    {
        var res = ViewData["allAvard"] as IEnumerable<DogsClub.WebUI.Models.Avard>;
        allAvard.AddRange(res.Select(item => new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }));
    }
}


<div>
    <div class="ConteinerAddExposition">
        @using (@Html.BeginForm())
        {
            @Html.AntiForgeryToken()
            <div class="ConteinerChengeUser">
                @Html.Hidden("idExposition", ViewData["idExposition"])

                <div class="NameAdd">Участник</div>
                @Html.DropDownList("idMember", allMember, new { @class = "EditText2" })

                <div class="NameAdd">Место</div>
                @Html.ValidationMessageFor(model => model.WinnerPlace, "", new { @class = "validationMessage" })
                @Html.EditorFor(model => model.WinnerPlace, new { htmlAttributes = new { @class = "EditText2" } })

                <div class="NameAdd">Награда</div>
                @Html.DropDownList("idAvard", allAvard, new { @class = "EditText2" })

                <input type="submit" value="Добавить" class="btn btn-info" id="AddButton" />
            </div>
        }
    </div>
</div>
